package top.sdrkyj.onecms.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.MessageFormat;

@Controller
public class HelloController {
    private static final Logger logger = LoggerFactory.getLogger(HelloController.class);

    @GetMapping("hello")
    @ResponseBody
    public String helloWorld(@RequestParam(required = false, defaultValue = "World") String name) {

        return MessageFormat.format("Hello, {0}", name);
    }

}
